package com.enki.cigarettes.repository;

import com.enki.cigarettes.entity.ProductSkuT;
import org.springframework.data.domain.Sort;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * @author WCS.Wang
 * @version V1.0
 * @Package com.enki.cigarettes.repository
 * @Name e-cigarettes-shop-api-module
 * @Description: TODO 商品属性数据层
 * @date 2019-07-19
 */
public interface ProductSkuTRepository extends PagingAndSortingRepository<ProductSkuT, String> {

    List<ProductSkuT> findByProductTIdAndStatus(long productTId, int status, Sort sort);

    ProductSkuT findOneByProductTIdAndSkuCodeAndStatus(long productTId, String skuCode, int status);

    List<ProductSkuT> findByProductTIdAndSkuCodeLikeAndStatus(long productTId, String skuCode, int status, Sort sort);

    ProductSkuT findOneByIdAndStatus(String id, int status);

    ProductSkuT findFirstById(String id);
}
